package com.example.springbootpay.service.impl;

import com.example.springbootpay.service.AbstractPaymentTemplate;
import org.springframework.stereotype.Component;

@Component
public class FlashPayment extends AbstractPaymentTemplate {
    // 原pay方法可能不再需要，可根据实际情况保留或删除
    // public void pay() {
    //     // 实现闪付逻辑
    //     System.out.println("Flash payment processed");
    // }
    @Override
    protected String doUnifiedOrder(String orderId, Integer amount) {
        return "闪付预支付成功，订单号：" + orderId + " 金额：" + amount + "分";
    }

    @Override
    public String doOrderQuery(String orderId) {
        return "闪付订单查询成功，订单状态：已支付";
    }

    @Override
    public String doRefund(String orderId, Integer amount) {
        return "闪付退款成功，退款金额：" + amount + "分";
    }
}